#include <STC89C5xRC.H>
#include "delay.h"
#include "key.h"
#include "timer0.h"
#include "nixie.h"


unsigned char counter,compare;
sbit DA=P2^1;

unsigned char i;

void main()
{
	Timer0_Init();
	while(1)
	{
		for(i=0;i<100;i++)
		{
			compare=i;
			Delayms(10);
		}
		for(i=100;i>0;i--)
		{
			compare=i;
			Delayms(10);
		}
	}

}

//定时器中断函数模板100us
void timer0_routine() interrupt 1
{
    TL0 = 0xA4;				//设置定时初始值
    TH0 = 0xFF;				//设置定时初始值
	counter++;
	if(counter>=100)
	{
		counter=0;
	}
	if(counter<compare)
	{
		DA=1;
	}
	else
	{
		DA=0;
	}



}
